/*
 * @Author:aili
 * @Date: 2023-09-05 11:33:08
 * @LastEditTime: 2023-12-03 11:35:49
 * @LastEditors: aili
 * @Description:
 * @FilePath: \vue3admin\src\config\ipConfig.js
 *
 */
// export function getBaseLoginEnv() {
//   let loginEnv //登录环境变量
//   const base = window.location.host //获取当前的域名
//   switch (base) {
//     case 'test-sit':
//       loginEnv = 'sit'
//       break
//     case 'test-uat':
//       loginEnv = 'uat'
//       break

//     case 'test-prod':
//       loginEnv = 'prod'
//       break

//     default: //默认若以上情况均不符合时执行
//       loginEnv = 'sit' //开发环境

//       break
//   }
//   return loginEnv
// }

export const keyWord = '1234567890123456'
export const informationTerms = 'https://xxx.com/pdffiles/yssq/bqdlyssqtk.pdf'
function getEnv() {
  const url = window.location.href
  let environment = ''
  if (url.indexOf('dev-') !== -1) {
    //开发环境
    environment = 'dev'
  } else if (url.indexOf('sit-') !== -1) {
    //sit测试环境
    environment = 'sit'
  } else if (url.indexOf('uat-') !== -1) {
    //uat测试环境
    environment = 'uat'
  } else if (url.indexOf('pr-') !== -1) {
    //预生产环境
    environment = 'pr'
  } else if (url.indexOf('prod-') !== -1) {
    //生产环境
    environment = 'product'
  } else {
    //本地环境
    environment = 'dev'
  }
  return environment
}
export const env = getEnv()
console.log('env', env)
const GlobalConfig = {
  dev: {
    env: 'DEV',
    serverPath: 'http://sph-api.atguigu.cn', //本地开发
    // serverPath: 'https://gears.pc.ehuatai.com:9040', //本地开发
    pcip: 'https://sit-wechat.life.x456xx.com',
    pid: 'gh_c4e93bfe4400',
    SystemCode: 'grpdevpc'
  },
  sit: {
    env: 'SIT',
    serverPath: 'http://dev-vue3admin-api.life.xxx.com:8091/api',
    pcip: 'http://dev-vue3admin-api.life.xxx.com',
    pid: 'fh_c4e9dhe4456',
    SystemCode: 'adminpc'
  },
  uat: {
    env: 'UAT',
    serverPath: 'http://dev-vue3admin-api.life.xxx.com:8091/api',
    pcip: 'https://uat-wechat.life.ehuatai.com',
    pid: 'gh_11e006fdd4a8',
    SystemCode: 'grppc'
  },
  pr: {
    env: 'PR',
    serverPath: 'http://dev-vue3admin-api.life.xxx.com:8091/api',
    pcip: 'https://pr-wechat.life.ehuatai.com',
    pid: 'gh_b0c82ebd8750',
    SystemCode: 'grppc'
  },
  product: {
    env: 'PRODUCT',
    serverPath: 'https://prod-htgateway.life.ehuatai.com/ams/',
    pcip: 'https://pr-wechat.life.ehuatai.com',
    pid: 'gh_54c766af31b4',
    SystemCode: 'grppc'
  },
  local: {
    env: 'local',
    serverPath: '/api', //本地开发测试：不走网关校验
    pcip: 'https://pr-wechat.life.ehuatai.com',
    pid: 'gh_c4e93bfe4400',
    SystemCode: 'grppc'
  }
}

export default GlobalConfig[env]
